Skip to content

PXB-3609 : xbcloud delete leaves the .md5 file behind - #1777

Open
satya-bodapati wants to merge 1 commit into
percona:8.4from
satya-bodapati:PXB-8.4-3609
Open

PXB-3609 : xbcloud delete leaves the .md5 file behind#1777
satya-bodapati wants to merge 1 commit into
percona:8.4from
satya-bodapati:PXB-8.4-3609

Conversation

@satya-bodapati

Copy link
Copy Markdown
Contributor

https://perconadev.atlassian.net/browse/PXB-3609

xbcloud put --md5 uploads the checksum file as <backup_name>.md5, next to the backup directory and not inside it. xbcloud delete lists only what is under <backup_name>/, so the .md5 file xbcloud generated was never deleted and stayed in the bucket after the backup itself was gone.

Delete <backup_name>.md5 along with the backup.

At delete time we do not know whether the backup was taken with --md5, so the delete is unconditional and delete_object() takes a best_effort flag for it: an object that is not there, or that we have no permission on, is not reported as an error. S3 answers 204 for a DELETE of a missing key while Azure and Swift answer 404, and a user whose rights are scoped to <backup_name>/* gets 403 for the .md5 file whether it exists or not. In all of those cases we stay quiet and leave things as they were before this fix. Real errors are still reported, and the backup itself is deleted as usual.

We do not check whether the file exists before deleting it, so that delete does not start requiring s3:GetObject - a retention user with only ListBucket and DeleteObject must still be able to remove a backup.

Tests: md5_delete, md5_delete_permissions, md5_delete_prefix_scope.

@satya-bodapati satya-bodapati self-assigned this Aug 13, 2026
@satya-bodapati

Copy link
Copy Markdown
Contributor Author

https://perconadev.atlassian.net/browse/PXB-3609

xbcloud put --md5 uploads the checksum file as <backup_name>.md5, next to
the backup directory and not inside it. xbcloud delete lists only what is
under <backup_name>/, so the .md5 file xbcloud generated was never deleted
and stayed in the bucket after the backup itself was gone.

Delete <backup_name>.md5 along with the backup.

At delete time we do not know whether the backup was taken with --md5, so
the delete is unconditional and delete_object() takes a best_effort flag for
it: an object that is not there, or that we have no permission on, is not
reported as an error. S3 answers 204 for a DELETE of a missing key while
Azure and Swift answer 404, and a user whose rights are scoped to
<backup_name>/* gets 403 for the .md5 file whether it exists or not. In all
of those cases we stay quiet and leave things as they were before this fix.
Real errors are still reported, and the backup itself is deleted as usual.

We do not check whether the file exists before deleting it, so that delete
does not start requiring s3:GetObject - a retention user with only
ListBucket and DeleteObject must still be able to remove a backup.

Tests: md5_delete, md5_delete_permissions, md5_delete_prefix_scope.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants